define(function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function() {
                return {  
                   user_info:{
                    
                   },
                   store:{
                    
                   }
                };
            },
            el: '#pageIndex',
            created: function() {
                this.fetchData();
            },
            methods: {
                fetchData: function() {
                    var _this = this;
                    this.from=this.$route.params.from;
                    var user_info = app.getUserInfo();
                    app.get("api/user/info",{user_id:user_info.user_id},function(res){
                        if(res.code!=200){
                            app.alert(res.msg);
                            return;
                        }
                        _this.user_info = res.data;
                    });
                    app.getStore(function(store){
                        _this.store = store;
                    });
                    
                },
                user_info_open_vip:function(){
                    var store_id = app.getStoreId();
                    var url ='https://wap.bestsmartbee.com/pages/wx-card/?store_id='+store_id+'#/opencard/store_id_'+store_id+'/0';
                    window.location.href = url;
                }
                
 
            }

        }).$mount('#app');
    };
    module.exports = controller;
});
